import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/view/login/Login'
import Main from '@/view/main/Main'
import user from '@/router/user'// 用户模块的路由
import Error404 from '@/view/error/error404' // 404
Vue.use(Router)
export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
      children: user
    },
    {
      path: '/main/error404',
      name: 'error404',
      component: Error404
    },
    // 放最后
    {
      path: '*',
      redirect: '/#/main/error404'
    }
  ]
})
